﻿@model IEnumerable<shop.DanhMuc>
          
              <select name="MaDM">
                  @foreach(var item in Model)
                      {
                       if(ViewBag.type =="1")
                       {
                         <optgroup label="@item.DanhMuc1"> @item.DanhMuc1</optgroup>
                        @Html.Action("dropbycha", "Partial", new { type = ViewBag.type, idcha = item.IDCha, MaDM = ViewBag.MaDM })  
                       }
                       else
                       {
                         <optgroup label="@item.DanhMuc1"> @item.DanhMuc1</optgroup>
                        @Html.Action("dropbycha", "Partial", new { type = ViewBag.type, idcha = item.IDCha })  
                       } 
                     }
              </select> 
               
           